package com.pfc.others;


import java.util.Enumeration;
import java.util.Hashtable;

public class Lectura {

	private Hashtable<String, Element> listaLectura;
	
	
	public Lectura(Hashtable<String, Element> lista) {
		this.listaLectura = lista;
	}
	
	public Lectura() {
		this.listaLectura = new Hashtable<String, Element>();
	}

	public Hashtable<String, Element> getLista() {
		return listaLectura;
	}

	public void setLista(Hashtable<String, Element> lista) {
		this.listaLectura = lista;
	}
	
	public void add(Element e){
		String bssid = e.getBssid();
		this.listaLectura.put(bssid, e);
	}
	
	public int size(){
		return this.listaLectura.size();
	}
	
	public Element get(String bssid){
		return this.listaLectura.get(bssid);
	}
	
	public String toString(){
		String s = "";
		Enumeration<String> enumer = this.getLista().keys();
		while (enumer.hasMoreElements()){
			Element e =  this.get(enumer.nextElement());
			s = s + e.toString();
		}
		return s;
	}
	
	public int getLevelByBSSID(String bssid){
		Element e = this.getLista().get(bssid);
		int level = e.getLevel();
		return level;
	}
	
	public boolean containsBSSID(String bssid){
		return this.listaLectura.containsKey(bssid);
	}
}
